-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not transform solution project dependencies into ProjectReference dependencies #1422
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure we should do this workaround instead of fixing #939. Then there wouldn't be anything special about SDK projects' solution build.
If we want to fix this for 15.3, this workaround seems like a good idea. For 15.5 I'd rather see the root cause fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last comment was supposed to be red, not green, sorry.
I think this change could be orthogonal to #939. It enables msbuild to behave like VS does, in the presence of sln based project dependencies. Without this change msbuild injects an extra ProjectReference, whereas VS does not. This makes building in VS different from building in the command line. Right now this difference in behaviour exposes #939. In the future it might have other random side effects. |
In addition, the right user gesture for #939 is to explicitly declare a project reference inside the csproj file, whereas this PR handles the case when the user wants (for some unknown reason) a sln based dependency. On the other hand, we could consider sln based dependencies obsolete, and in that sense encourage users to mark the dependency accordingly in the csproj instead. From this point of view it makes sense to not take this PR, and guide users to the correct solution when they use sln based dependencies and get a build error from the command line. |
When MSBuild is generating the from-solution-dependencies This knob is orthogonal to correct ProjectReference behavior, but I'm concerned about changing the in-solution build experience only for SDK projects. That seems like something that'd come back to bite us in the future. |
…0200427.16 (dotnet#1422) - Microsoft.AspNetCore.Analyzers: 5.0.0-preview.5.20226.5 -> 5.0.0-preview.5.20227.16 - Microsoft.AspNetCore.Mvc.Analyzers: 5.0.0-preview.5.20226.5 -> 5.0.0-preview.5.20227.16 - Microsoft.AspNetCore.Components.Analyzers: 5.0.0-preview.5.20226.5 -> 5.0.0-preview.5.20227.16 - Microsoft.AspNetCore.Mvc.Api.Analyzers: 5.0.0-preview.5.20226.5 -> 5.0.0-preview.5.20227.16 Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Fixes dotnet/msbuild#2274